home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-21 | 478 b | 17 lines | [TEXT/ttxt] |
- --<<<
-
- method getUpperCase self {class String} -> (
- local lowers := new NumberRange lowerBound:97 upperBound:122
- local upperCaser := getFirst "a" - getFirst "A"
- -- make it handle string constants by coercing them to strings
- if self.mutable = false do self := self as String
- local myIterator := iterate self
- repeat while (next myIterator) do (
- if (withinRange lowers myIterator.value) do (
- myIterator.value := myIterator.value - upperCaser
- )
- )
- return self
- )
-
- -->>>